package com.xwm93up.javatips.mapper;

import com.xwm93up.javatips.dto.OrderDto;
import com.xwm93up.javatips.po.Order;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @Description: desc
 * @Author: xwm93up
 * @Since: 2021/10/27 16:31
 */
@Mapper(uses = {MemberMapper.class, ProductMapper.class})
public interface OrderMapper {
    OrderMapper INSTANCE = Mappers.getMapper(OrderMapper.class);

    @Mapping(source = "member", target = "memberDto")
    @Mapping(source = "productList", target = "productDtoList")
    OrderDto toDto(Order order);
}
